part of '../../repository.dart';

const _kGooglePlayPurchasedSubscriptionAbsentPriceChangeStatusValue = 'absent';
const _kGooglePlayPurchasedSubscriptionAcceptedPriceChangeStatusValue = 'accepted';
const _kGooglePlayPurchasedSubscriptionPendingPriceChangeStatusValue = 'pending';

class _GooglePlayPurchasedSubscriptionPriceChangeStatusDto extends Equatable {
  const _GooglePlayPurchasedSubscriptionPriceChangeStatusDto._internal({
    required this.priceChangeStatusString,
  });

  final String priceChangeStatusString;

  @override
  List<Object?> get props {
    return [
      priceChangeStatusString,
    ];
  }

  factory _GooglePlayPurchasedSubscriptionPriceChangeStatusDto.fromString(
      String priceChangeStatusString) {
    return _GooglePlayPurchasedSubscriptionPriceChangeStatusDto._internal(
      priceChangeStatusString: priceChangeStatusString,
    );
  }

  GooglePlayPurchasedSubscriptionPriceChangeStatus toEntity() {
    return switch (priceChangeStatusString) {
      _kGooglePlayPurchasedSubscriptionAbsentPriceChangeStatusValue =>
        GooglePlayPurchasedSubscriptionPriceChangeStatus.absent,
      _kGooglePlayPurchasedSubscriptionAcceptedPriceChangeStatusValue =>
        GooglePlayPurchasedSubscriptionPriceChangeStatus.accepted,
      _kGooglePlayPurchasedSubscriptionPendingPriceChangeStatusValue =>
        GooglePlayPurchasedSubscriptionPriceChangeStatus.pending,
      _ => throw UnimplementedError(),
    };
  }
}
